#ifndef SALESDETAILS_H
#define SALESDETAILS_H

#include <QWidget>
#include "saleorderform.h"
#include "saledetail.h"

class Calendar;
class InquireSql;

namespace Ui {
class SalesDetails;
}

enum InquireSalesDetailsManner {SalesOrderForm, MemberID, staffName};

class SalesDetails : public QWidget
{
    Q_OBJECT
    
public:
    explicit SalesDetails(QWidget *parent = 0);
    ~SalesDetails();
    bool eventFilter(QObject *target, QEvent *event);
    void displayTableWidgetSalesOrderForm();
    void displayTableWidgetSalesDetails(QString);
    void displayTableWidgetSalesList();
    void initLineEditTime();
    enum LineEditSalesDetails {start = 4, end};

private slots:
    void slotUpdateLineEditDate(QString);

    void on_pushButtonInquire_clicked();

    void on_comboBox_activated(int index);

    void on_tableWidgetSalesOrderForm_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);

private:
    Ui::SalesDetails *ui;

    void setQtableWidgetHeaderStyle();

    void setQtableWidgetSalesDetailsHeaderStyle();

    void setQtableWidgetSalesListHeaderStyle();

    void setTableWidgetColor();

    void setTableWidgetSalesDetailsColor();

    void setTableWidgetSalesListColor();

    QString completionPrice(const QString &);

    Calendar *m_calendar;

    InquireSql *m_sql;

    SaleOrderFormList m_saleOrderFormList;

    saleDetailList m_saleDetailList;

    int m_LineEdit;

    bool LineEditEnable;

    bool clearTableWidgetSalesOrderForm;
};

#endif // SALESDETAILS_H
